<template>
  <div>
    <slot  :banner="banner">
      <el-carousel >
        <el-carousel-item v-for="item in banner" :key="item.index">
          <img class="banner_img" :src="item.imageUrl" alt="">
        </el-carousel-item>
      </el-carousel>
    </slot>
  </div>
</template>

<script>
export default {
    data(){
        return{
            banner:[]
        }
    },
    mounted() {
        this.$http.get("http://47.108.197.28:3000/banner").then((res)=>{
            // console.log(res)
            this.banner=res.data.banners
        })
    },
};
</script>

<style>
    .banner_img{
        width: 100%;
        height: 100%;
    }
</style>